﻿@model DTcms.Model.BaseModel
@{
    ViewBag.Title = "购物车-" + Model.site.name;
    string templateskin = Model.templateskin;
    var goodsList = (List<DTcms.Model.cart_items>)Model.info["goodsList"];
    var goodsTotal = (DTcms.Model.cart_total)Model.info["goodsTotal"];
}
@section HeaderContent{
    <script type="text/javascript" charset="utf-8" src="@Model.templateskin/js/cart.js"></script>
}
<!--当前位置-->
<div class="section">
    <div class="location">
        <span>当前位置：</span>
        <a href="@Html.linkurl("index")">首页</a> &gt;
        <a href="@Html.linkurl("cart")">购物车</a>
    </div>
</div>
<!--/当前位置-->
<!--页面内容-->
<div class="section">
    <div class="wrapper">
        <div class="bg-wrap">
            <!--购物车头部-->
            <div class="cart-head clearfix">
                <h2><i class="iconfont icon-cart"></i>我的购物车</h2>
                <div class="cart-setp">
                    <ul>
                        <li class="first active">
                            <div class="progress">
                                <span>1</span>
                                放进购物车
                            </div>
                        </li>
                        <li>
                            <div class="progress">
                                <span>2</span>
                                填写订单信息
                            </div>
                        </li>
                        <li class="last">
                            <div class="progress">
                                <span>3</span>
                                支付/确认订单
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
            <!--购物车头部-->
            <!--商品列表-->
            <div class="cart-box">
                <input id="jsondata" name="jsondata" type="hidden" />
                <table width="100%" class="layui-table" lay-skin="line" border="0" cellspacing="0" cellpadding="8">
                    <thead>
                        <tr>
                            <th width="48">
                                <a onclick="selectCart(this);" href="javascript:;">全选</a>
                            </th>
                            <th colspan="2">商品信息</th>
                            <th width="84">单价</th>
                            <th width="104">数量</th>
                            <th width="104">金额(元)</th>
                            <th width="84">积分</th>
                            <th width="54">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var modelt in goodsList)
                        {
                            <tr>
                                <td>
                                    <input type="checkbox" name="checkall" class="checkall" onclick="selectCart();" />
                                    <input name="hideChannelId" type="hidden" value="@modelt.channel_id" />
                                    <input name="hideArticleId" type="hidden" value="@modelt.article_id" />
                                    <input name="hideGoodsId" type="hidden" value="@modelt.goods_id" />
                                    <input name="hideStockQuantity" type="hidden" value="@modelt.stock_quantity" />
                                    <input name="hideGoodsPrice" type="hidden" value="@modelt.user_price" />
                                    <input name="hidePoint" type="hidden" value="@modelt.point" />
                                </td>
                                <td width="68">
                                    <a target="_blank" href="@Html.linkurl("goods_show",modelt.article_id)">
                                        <img src="@modelt.img_url" class="img" />
                                    </a>
                                </td>
                                <td>
                                    <a target="_blank" href="@Html.linkurl("goods_show",modelt.article_id)">@modelt.title</a>
                                    <p class="stxt">@modelt.spec_text</p>
                                </td>
                                <td>
                                    ￥@modelt.user_price
                                </td>
                                <td>
                                    <div class="buy-box">
                                        <a href="javascript:;" class="reduce" onclick="updateCart(this, '/', -1);">-</a>
                                        <input type="text" style="width:30px" name="goodsQuantity" class="input" value="@modelt.quantity" onblur="updateCart(this, '/');" onkeydown="return checkNumber(event);" />
                                        <a href="javascript:;" class="subjoin" onclick="updateCart(this, '/', 1);">+</a>
                                    </div>
                                </td>
                                <td>
                                    <span class="red">
                                        ￥<label name="amountCount">@(modelt.user_price * modelt.quantity)</label>
                                    </span>
                                </td>
                                <td>
                                    <label name="pointCount">
                                        @(modelt.point > 0 ? "+" : "")
                                        @(modelt.point * modelt.quantity)
                                    </label>
                                </td>
                                <td>
                                    <a onclick="deleteCart('/', this);" href="javascript:;">删除</a>
                                </td>
                            </tr>
                        }
                        @if (goodsList.Count < 1)
                        {
                            <tr>
                                <td colspan="10">
                                    <div class="msg-tips">
                                        <div class="icon warning"><i class="iconfont icon-tip"></i></div>
                                        <div class="info">
                                            <strong>购物车没有商品！</strong>
                                            <p>您的购物车为空，<a href="@Html.linkurl("index")">马上去购物</a>吧！</p>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                        }
                        <tr>
                            <th align="right" colspan="8">
                                已选择商品 <b class="red" id="totalQuantity">0</b> 件 &nbsp;&nbsp;&nbsp;
                                商品总金额（不含运费）：<span class="red">￥</span><b class="red" id="totalAmount">0</b>元
                            </th>
                        </tr>
                    </tbody>
                </table>
            </div>
            <!--/商品列表-->
            <!--购物车底部-->
            <div class="cart-foot clearfix">
                <div class="left-box">
                    <a onclick="selectCart(this);" href="javascript:;">全选</a>
                    <a onclick="deleteCart('/');" href="javascript:;">清空购物车</a>
                </div>
                <div class="right-box">
                    <button class="button" onclick="javascript:location.href='@Html.linkurl("index")';">继续购物</button>
                    <button class="submit" onclick="formSubmit(this, '/', '@Html.linkurl("shopping")');">立即结算</button>
                </div>
            </div>
            <!--购物车底部-->
        </div>
    </div>
</div>
<!--/页面内容-->
@section Scripts{

}